var buttonNormal : Texture2D;
var buttonHover : Texture2D;
var buttonClick : Texture2D;

var blackberryCount : GameObject;
var mainCamera : GameObject;

private var blackberryScript : BlackberriesCount;
private var clickScript : ClickScript;

function Start (){
blackberryScript = blackberryCount.gameObject.GetComponent("BlackberriesCount");
clickScript = mainCamera.gameObject.GetComponent("ClickScript");
}


function OnMouseEnter()
{
	renderer.material.mainTexture = buttonHover;
	
}

function OnMouseExit()
{
	renderer.material.mainTexture = buttonNormal;
}

function OnMouseDown()
{
	renderer.material.mainTexture = buttonClick;
}


function OnMouseUp()
{
	if (blackberryScript.blackberryCount > 0){
		blackberryScript.Decrease();
		clickScript.DecreaseTotal();
	}
}